/*
 *  CPPOutput.h
 *  SoundOutputter
 *
 *  Created by Pierre DUCHENE on 10/02/10.
 *  Copyright 2010 Pierre DUCHENE. All rights reserved.
 *
 */

#include <AudioUnit/AudioUnit.h>
#include <AudioToolbox/AudioToolbox.h>
#include <AudioUnit/AudioUnitProperties.h>
#include <CoreAudio/CoreAudio.h>
#include <CoreServices/CoreServices.h>
#import "SynthKit.h"

// These functions are the only access to output
void AddDataToBuffer(float* data, unsigned int size);
void DisplayBuffer();
void ClearBuffer();
unsigned int GetSize();
unsigned int getbufferOutputIndex();
float* GetBuffer();
float* GetNextValues(int nbValues);
int NBSampleRead();

// Audio Unit Methods
int OpenOutput();

int CloseOutput();

int Start();

int Stop();

OSStatus MyAURenderCallback (
							 void                        *inRefCon,
							 AudioUnitRenderActionFlags  *ioActionFlags,
							 const AudioTimeStamp        *inTimeStamp,
							 UInt32                      inBusNumber,
							 UInt32                      inNumberFrames,
							 AudioBufferList             *ioData
							 );
